package com.mybatisx.mybatisplus.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.util.Date;

import java.io.Serializable;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 *
 * </p>
 *
 * @author lyh
 * @since 2021-06-22
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)

public class User implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 姓名
     */
    private String name;

    /**
     * 年龄
     */
    private Integer age;

    /**
     * 邮箱
     */
    private String email;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 最后修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    /*
         删除标识
    */
   // @TableLogic(value = "0",delval = "1")  //添加默认为逻辑删除, 去掉改注解是物理删除
    @TableField(fill = FieldFill.INSERT)
    private Integer delTag;


    @TableField(fill = FieldFill.INSERT)
    @Version
    private Integer version;  //版本号    version用于乐观锁

   public User(Long id,String name,Integer age){
        this.id=id;
        this.name=name;
        this.age=age;
   }

   public User(){

   }

}
